#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdbool.h>
int main()
{
	int n = 0;
	int k = 0;
	scanf("%d %d", &n, &k);
	bool light[1001] = {false};
	for (int i = 1; i <= k; i++)
	{
		for (int j = i; j <= n; j+=i)
		{
			light[j] = !light[j];
		}
	}

	for (int i = 1; i <= n; i++)
	{
		if (light[i])
			printf("%d ", i);
	}
	return 0;
}